home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / Documentation / MPW Reference / Online Reference / Prog. Asst. Tools for MPW / UserStartup•MPTA < prev   
Encoding:
Text File  |  1996-04-18  |  2.3 KB  |  64 lines  |  [TEXT/MPS ]

  1. # Macintosh Programmer’s Assistant
  2. # Copyright © 1986-1996 Apple Computer, Inc. All rights reserved.
  3. #
  4. # -- brain surgery provided by the MPW Gurus, 1/12/95, 3/29/96
  5. #
  6. # ------------------------------- #
  7. # UserStartup•MPTA
  8. # ------------------------------- #
  9. #
  10. # Put this file in the same folder as the MPW Shell.
  11. #
  12. # This startup script defines the {MPTA_Location} and {MPTA_AppName} variables
  13. # for use by the MPTA_MPWAccess script.
  14. #
  15. # It also adds a menu called "Info" to the MPW Shell menu bar with items that
  16. # let you look up the description of a toolbox routine, the description of an
  17. # MPW command, or return the C template for a toolbox routine.
  18. #
  19.  
  20. set saveExit {Exit}
  21. set exit 0
  22. set hasSendAE "`which SendAE ≥dev:null`"
  23. if "{hasSendAE}" ≠ ""
  24.     #    Set the location of the Macintosh Programmer’s Assistant folder.
  25.     #         If the folder can’t be found, prompt the user for it and remember
  26.     #         where the folder was found.
  27.     #         Note that we have to make sure that the path is still valid.
  28.     #         There may be a path stored that is no longer valid.
  29.     
  30.     if  ¬ "{MPTA_Location}" && "`Exists "{ShellDirectory}"MPTA_FullPathName`" 
  31.         Set MPTA_Location     "`Catenate "{ShellDirectory}"MPTA_FullPathName`"
  32.     end
  33.     
  34.     If ¬ "`Exists "{ShellDirectory}"MPTA_FullPathName`" || ¬ "`Exists "{MPTA_Location}"`"
  35.         Set temp "{ShellDirectory}"
  36.         Set temp "`(GetFileName "{temp}" -b "Here It Is" -t APPL -q -m "Locate the QuickView application.") ≥ dev:null`"
  37.         IF "{temp}"!= ""
  38.             Echo -n "{temp}" > "{ShellDirectory}"MPTA_FullPathName
  39.         END
  40.         set exit 1
  41.     end
  42.     
  43.     if "`Exists "{ShellDirectory}"MPTA_FullPathName`"
  44.     
  45.         Addmenu "Info" "Home Page" ('MPTA_MPWAccess LookupHomePage')
  46.         Addmenu "Info" '(-0' ''
  47.         Addmenu "Info" "Look Up Routine/E" ('MPTA_MPWAccess Lookup')
  48.         Addmenu "Info" "Look Up MPW Command" ('MPTA_MPWAccess LookupMPW')
  49.         Addmenu "Info" "Get Template/1" ('MPTA_MPWAccess GetTemplate')
  50. #        Addmenu "Info" '(-0' ''
  51. #        Addmenu "Info" "Release Notes" ('MPTA_MPWAccess LookupReleaseNotes')
  52.     
  53.         Set MPTA_Location "`Catenate "{ShellDirectory}"MPTA_FullPathName`"
  54.         (evaluate "{MPTA_Location}" =~ /(([¬:]+:)*)(≈)®1/ ) > Dev:Null
  55.         Set MPTA_AppName "{®1}"
  56.         Export MPTA_Location MPTA_AppName
  57.     end
  58. else    
  59.     Alert "Macintosh Programmer’s Assistant cannot locate the ‘SendAE’ tool.  Please reinstall Programmer’s Assistant properly."
  60. end
  61.  
  62. set exit {saveExit}
  63. unset hasSendAE saveExit
  64.